<?php

/**
 * company模型
 * @author 
 * @version 1.0
 * @package application
 * @subpackage application/models
 */
class Team_member_Model extends MY_Model {

    public function __construct() {
        parent::__construct();
        $this->_pk = 'id';
        $this->_attributes = array(
            'id' => '',
            'name' => '',
            'keywords' => '',
            'description' => '',
            'content' => '',
            'photo_url' => '',
            'big_img' => '',
            'depth' => '',
            'recycled' => '',
            'created' => '',
            'modified' => '',
            'status' => '',
        );
    }

    //上一篇
    public function pre($id) {
        $query = $this->db->select($this->get_datas_str())->from($this->table_name())
                        ->where(array('id <' => $id))//id与<之间要有空格
                        ->order_by("id", "desc")->limit(1, 0);
        return $query->get()->row_array();
    }

    //下一篇
    public function next($id) {
        $query = $this->db->select($this->get_datas_str())->from($this->table_name())
                        ->where(array('id >' => $id))//id与>之间要有空格
                        ->order_by("id", "asc")->limit(1, 0);
        return $query->get()->row_array();
    }

}
